﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="EduStoryPage.aspx.cs" Inherits="ZhaoPin.Feature.EduStoryPage" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
    <style type="text/css">
        .Grid
        {
            border: solid 1px #93c2f1;
            width: 98%;
            font-size: 11pt;
        }
        .Grid td
        {
            border-collapse: collapse;
            border: solid 1px #93c2f1;
            font-size: 11pt;
        }
        .Grid th
        {
            border-collapse: collapse;
            border: solid 1px #93c2f1;
            font-size: 11pt;
            background-color: #e4f6ff;
        }
        .err
        {
            color: Red;
        }
    </style>
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <ajaxToolkit:ToolkitScriptManager ID="ToolkitScriptManager" runat="server" EnableScriptGlobalization="true"
        EnableScriptLocalization="true">
    </ajaxToolkit:ToolkitScriptManager>
    <div align="center" style="width: 760px; font-size: 12pt; font-family: 新宋体;">
        <table border="1px" cellpadding="3px" cellspacing="0" width="760px">
            <tr>
                <td colspan="4">
                    填写学习经历格式样例
                </td>
            </tr>
            <tr>
                <td>
                    起止日期
                </td>
                <td>
                    学校名称
                </td>
                <td>
                    所学专业
                </td>
                <td>
                    学历学位
                </td>
            </tr>
            <tr>
                <td>
                    自2003年9月<br />
                    至2008年7月
                </td>
                <td>
                    青岛大学医学院
                </td>
                <td>
                    临床医学
                </td>
                <td>
                    本科学士
                </td>
            </tr>
            <tr>
                <td>
                    自2008年9月<br />
                    至2010年7月
                </td>
                <td>
                    青岛大学医学院
                </td>
                <td>
                    呼吸内科学
                </td>
                <td>
                    研究生硕士
                </td>
            </tr>
        </table>
        <div style="padding-top: 10px; padding-bottom: 10px">
            学习经历（从第一学历开始填写）</div>
        <asp:GridView ID="gvEduStory" runat="server" AutoGenerateColumns="False" Font-Size="15px"
            Width="760px" EmptyDataText="请添加学习经历" ShowHeaderWhenEmpty="True" CssClass="Grid"
            OnRowCommand="gvEduStory_RowCommand" DataSourceID="gvEduStory_EntityDataSource"
            DataKeyNames="Id" OnRowDataBound="gvEduStory_RowDataBound" 
            OnRowEditing="gvEduStory_RowEditing" EnableViewState="False">
            <Columns>
                <asp:TemplateField ShowHeader="False">
                    <HeaderTemplate>
                        <asp:LinkButton ID="btnInsert" runat="server" CausesValidation="False" CommandName="Insert"
                            Text="新增"></asp:LinkButton>
                    </HeaderTemplate>
                    <ItemTemplate>
                        <asp:LinkButton ID="btnEdit" runat="server" CausesValidation="False" CommandName="Edit"
                            Text="编辑"></asp:LinkButton>
                        <asp:LinkButton ID="btnDelete" runat="server" CausesValidation="False" CommandName="Delete"
                            Text="删除"></asp:LinkButton>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:BoundField HeaderText="入学时间" DataField="StartDate" DataFormatString="{0:Y}" />
                <asp:BoundField HeaderText="毕业时间" DataField="EndDate" DataFormatString="{0:Y}" />
                <asp:BoundField HeaderText="学校名称" DataField="University" />
                <asp:BoundField HeaderText="所学专业" DataField="Speciality" />
                <asp:TemplateField HeaderText="学历">
                    <ItemTemplate>
                        <asp:Label ID="lbEduLevel" runat="server" Text='<%# Eval("TDictEduLevel.FName") %>' />
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="学位">
                    <ItemTemplate>
                        <asp:Label ID="lbDegree" runat="server" Text='<%# Eval("TDictDegree.FName") %>' />
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="培养方式">
                    <ItemTemplate>
                        <asp:Label ID="lbEduType" runat="server" Text='<%# Eval("TDictEduType.FName") %>' />
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="学制">
                    <ItemTemplate>
                        <asp:Label ID="lbEduYear" runat="server" Text='<%# Eval("TDictEduYear.FName") %>' />
                    </ItemTemplate>
                </asp:TemplateField>
            </Columns>
        </asp:GridView>
        <asp:EntityDataSource ID="gvEduStory_EntityDataSource" runat="server" AutoGenerateWhereClause="True"
            ConnectionString="name=RecruitContainer" DefaultContainerName="RecruitContainer"
            EnableDelete="True" EnableFlattening="False" EntitySetName="EduStories" 
            EntityTypeFilter="EduStory" Where="" Include="TDictEduLevel,TDictDegree,TDictEduType,TDictEduYear"
            ContextTypeName="" EnableInsert="True" EnableUpdate="True" 
            OnInserting="gvEduStory_EntityDataSource_Inserting" OrderBy="it.StartDate asc">
            <WhereParameters>
                <asp:SessionParameter DbType="Guid" Name="PersonId" SessionField="UserId" />
            </WhereParameters>
        </asp:EntityDataSource>
        <div style="padding-top:10px">
        <asp:FormView ID="FormView1" runat="server" DefaultMode="Insert" OnPreRender="FormView1_PreRender"
            OnModeChanging="FormView1_ModeChanging" Visible="False"
            DataSourceID="gvEduStory_EntityDataSource" DataKeyNames="Id"
            OnItemUpdated="FormView1_ItemUpdated" EnableViewState="False">
            <EditItemTemplate>
                <table>
                    <tr>
                        <td>
                            入学时间
                        </td>
                        <td>
                            <asp:TextBox ID="tbStartDate" runat="server" Text='<%# Bind("StartDate","{0:Y}") %>'></asp:TextBox>
                            <ajaxToolkit:CalendarExtender runat="Server" ID="calStartDate" TargetControlID="tbStartDate"
                                Format="yyyy-MM" DefaultView="Years" />
                            <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="tbStartDate" CssClass="err" Text="!"></asp:RequiredFieldValidator>
                            
                        </td>
                        <td>
                            毕业时间
                        </td>
                        <td>
                            <asp:TextBox ID="tbEndDate" runat="server" Text='<%# Bind("EndDate","{0:Y}") %>'></asp:TextBox>
                            <ajaxToolkit:CalendarExtender runat="Server" ID="CalendarExtender1" TargetControlID="tbEndDate"
                                Format="yyyy-MM" DefaultView="Years" />
                                <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ControlToValidate="tbEndDate" CssClass="err" Text="!"></asp:RequiredFieldValidator>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            学校名称
                        </td>
                        <td>
                            <asp:TextBox ID="tbUniversity" runat="Server" Text='<%# Bind("University") %>'></asp:TextBox>
                            <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" ControlToValidate="tbUniversity" CssClass="err" Text="!"></asp:RequiredFieldValidator>
                        </td>
                        <td>
                            所学专业
                        </td>
                        <td>
                            <asp:TextBox ID="tbSpeciality" runat="Server" Text='<%# Bind("Speciality") %>'></asp:TextBox>
                            <asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server" ControlToValidate="tbSpeciality" CssClass="err" Text="!"></asp:RequiredFieldValidator>
                        </td>
                        <tr>
                            <td>
                                学历
                            </td>
                            <td>
                                <asp:DropDownList ID="ddEduLevelCode" runat="server" SelectedValue='<%# Bind("EduLevelCode") %>'
                                    DataSourceID="dsEduLevel" DataTextField="FName" DataValueField="FEduLevelCode">
                                </asp:DropDownList>
                                <asp:RequiredFieldValidator ID="RequiredFieldValidator5" runat="server" ControlToValidate="ddEduLevelCode" CssClass="err" Text="!" InitialValue="99999999" Display="Static"></asp:RequiredFieldValidator>
                                <asp:SqlDataSource ID="dsEduLevel" runat="server" ConnectionString="<%$ ConnectionStrings:RecruitLocalSqlServer %>"
                                    SelectCommand="SELECT * FROM [TDictEduLevel]"></asp:SqlDataSource>
                            </td>
                            <td>
                                学位
                            </td>
                            <td>
                                <asp:DropDownList ID="ddDegreeCode" runat="server" SelectedValue='<%# Bind("DegreeCode") %>'
                                    DataSourceID="dsDegreeCode" DataTextField="FName" DataValueField="FDegreeCode">
                                </asp:DropDownList>
                                
                                <asp:SqlDataSource ID="dsDegreeCode" runat="server" ConnectionString="<%$ ConnectionStrings:RecruitLocalSqlServer %>"
                                    SelectCommand="SELECT * FROM [TDictDegree]"></asp:SqlDataSource>
                            </td>
                        </tr>
                    </tr>
                    <tr>
                        <td>
                            培养方式
                        </td>
                        <td>
                            <asp:DropDownList ID="ddEduTypeCode" runat="server" SelectedValue='<%# Bind("EduTypeCode") %>'
                                DataSourceID="dsEduType" DataTextField="FName" DataValueField="FEduTypeCode">
                            </asp:DropDownList>
                            
                            <asp:SqlDataSource ID="dsEduType" runat="server" ConnectionString="<%$ ConnectionStrings:RecruitLocalSqlServer %>"
                                SelectCommand="SELECT * FROM [TDictEduType]"></asp:SqlDataSource>
                        </td>
                        <td>
                            学制
                        </td>
                        <td>
                            <asp:DropDownList ID="ddEduYearsCode" runat="server" SelectedValue='<%# Bind("EduYearsCode") %>'
                                DataSourceID="dsEduYears" DataTextField="FName" DataValueField="FEduYearsCode">
                            </asp:DropDownList>
                            
                            <asp:SqlDataSource ID="dsEduYears" runat="server" ConnectionString="<%$ ConnectionStrings:RecruitLocalSqlServer %>"
                                SelectCommand="SELECT * FROM [TDictEduYears]"></asp:SqlDataSource>
                        </td>
                    </tr>
                </table>
                <asp:LinkButton ID="UpdateButton" runat="server" CausesValidation="True" CommandName="Update"
                    Text="更新"></asp:LinkButton>
                <asp:LinkButton ID="CancelButton" runat="server" CausesValidation="False" CommandName="Cancel"
                    Text="取消"></asp:LinkButton>
            </EditItemTemplate>
            <InsertItemTemplate>
                              <table>
                    <tr>
                        <td>
                            入学时间
                        </td>
                        <td>
                            <asp:TextBox ID="tbStartDate" runat="server" Text='<%# Bind("StartDate","{0:Y}") %>'></asp:TextBox>
                            <ajaxToolkit:CalendarExtender runat="Server" ID="calStartDate" TargetControlID="tbStartDate"
                                Format="yyyy-MM" DefaultView="Years" />
                            <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="tbStartDate" CssClass="err" Text="!"></asp:RequiredFieldValidator>
                            
                        </td>
                        <td>
                            毕业时间
                        </td>
                        <td>
                            <asp:TextBox ID="tbEndDate" runat="server" Text='<%# Bind("EndDate","{0:Y}") %>'></asp:TextBox>
                            <ajaxToolkit:CalendarExtender runat="Server" ID="CalendarExtender1" TargetControlID="tbEndDate"
                                Format="yyyy-MM" DefaultView="Years" />
                                <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ControlToValidate="tbEndDate" CssClass="err" Text="!"></asp:RequiredFieldValidator>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            学校名称
                        </td>
                        <td>
                            <asp:TextBox ID="tbUniversity" runat="Server" Text='<%# Bind("University") %>'></asp:TextBox>
                            <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" ControlToValidate="tbUniversity" CssClass="err" Text="!"></asp:RequiredFieldValidator>
                        </td>
                        <td>
                            所学专业
                        </td>
                        <td>
                            <asp:TextBox ID="tbSpeciality" runat="Server" Text='<%# Bind("Speciality") %>'></asp:TextBox>
                            <asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server" ControlToValidate="tbSpeciality" CssClass="err" Text="!"></asp:RequiredFieldValidator>
                        </td>
                        <tr>
                            <td>
                                学历
                            </td>
                            <td>
                                <asp:DropDownList ID="ddEduLevelCode" runat="server" SelectedValue='<%# Bind("EduLevelCode") %>'
                                    DataSourceID="dsEduLevel" DataTextField="FName" DataValueField="FEduLevelCode">
                                </asp:DropDownList>
                                <asp:RequiredFieldValidator ID="RequiredFieldValidator5" runat="server" ControlToValidate="ddEduLevelCode" CssClass="err" Text="!" InitialValue="99999999" Display="Static"></asp:RequiredFieldValidator>
                                <asp:SqlDataSource ID="dsEduLevel" runat="server" ConnectionString="<%$ ConnectionStrings:RecruitLocalSqlServer %>"
                                    SelectCommand="SELECT * FROM [TDictEduLevel]"></asp:SqlDataSource>
                            </td>
                            <td>
                                学位
                            </td>
                            <td>
                                <asp:DropDownList ID="ddDegreeCode" runat="server" SelectedValue='<%# Bind("DegreeCode") %>'
                                    DataSourceID="dsDegreeCode" DataTextField="FName" DataValueField="FDegreeCode">
                                </asp:DropDownList>
                                
                                <asp:SqlDataSource ID="dsDegreeCode" runat="server" ConnectionString="<%$ ConnectionStrings:RecruitLocalSqlServer %>"
                                    SelectCommand="SELECT * FROM [TDictDegree]"></asp:SqlDataSource>
                            </td>
                        </tr>
                    </tr>
                    <tr>
                        <td>
                            培养方式
                        </td>
                        <td>
                            <asp:DropDownList ID="ddEduTypeCode" runat="server" SelectedValue='<%# Bind("EduTypeCode") %>'
                                DataSourceID="dsEduType" DataTextField="FName" DataValueField="FEduTypeCode">
                            </asp:DropDownList>
                            
                            <asp:SqlDataSource ID="dsEduType" runat="server" ConnectionString="<%$ ConnectionStrings:RecruitLocalSqlServer %>"
                                SelectCommand="SELECT * FROM [TDictEduType]"></asp:SqlDataSource>
                        </td>
                        <td>
                            学制
                        </td>
                        <td>
                            <asp:DropDownList ID="ddEduYearsCode" runat="server" SelectedValue='<%# Bind("EduYearsCode") %>'
                                DataSourceID="dsEduYears" DataTextField="FName" DataValueField="FEduYearsCode">
                            </asp:DropDownList>
                            
                            <asp:SqlDataSource ID="dsEduYears" runat="server" ConnectionString="<%$ ConnectionStrings:RecruitLocalSqlServer %>"
                                SelectCommand="SELECT * FROM [TDictEduYears]"></asp:SqlDataSource>
                        </td>
                    </tr>
                </table>
                <asp:LinkButton ID="InsertButton" runat="server" CausesValidation="True" CommandName="Insert"
                    Text="新增"></asp:LinkButton>
                <asp:LinkButton ID="CancelButton" runat="server" CausesValidation="False" CommandName="Cancel"
                    Text="取消"></asp:LinkButton>
            </InsertItemTemplate>
        </asp:FormView>
        </div>
        <div style="padding-top:10px">
        <asp:ValidationSummary ID="ValidationSummary1" runat="server" 
            EnableViewState="False" ForeColor="Red" HeaderText="请填写!号标识的内容" />
        </div>

    </div>
    </form>
</body>
</html>
